package mskruch.gps;

import gpstools.Location;
import gpstools.TrainingPoint;

public class PointFactory {
    private PointFactory() {
        throw new AssertionError("Not instantiable class");
    }

    public static Position newPosition(double longitude, double latitude) {
		return new GpsToolsPoint(longitude, latitude, null, 0, null, null);
    }

    public static Point newPoint(double longitude, double latitude, double elevation, long time) {
        return new GpsToolsPoint(longitude, latitude, elevation, time, null, null);
    }

    public static Point newPoint(double longitude, double latitude, double elevation, long time, Short heartRate,
            Short cadence) {
        return new GpsToolsPoint(longitude, latitude, elevation, time, heartRate, cadence);
    }
    
    public static Waypoint newWaypoint(double longitude, double latitude, String label) {
        return new GpsToolsWaypoint(longitude, latitude, label);
    }

    public static Waypoint newWaypoint(Position position, String label) {
        return new GpsToolsWaypoint(position.getLongitude(), position.getLatitude(), label);
    }

    public static Point newPoint(TrainingPoint point) {
        return new GpsToolsPoint(point.getLongitude(), point.getLatitude(), point.getElevation(), point.getTime(), point.getHeartRate(), point.getCadence());
    }

    public static Position newPosition(Location first) {
        return newPosition(first.getLongitude(), first.getLatitude());
    }
}
